package face.pay.task.card;

import face.pay.task.card.service.ICpnCardMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class CardMessageTask {

    @Autowired
    private ICpnCardMessageService cpnCardMessageService;

    /**
     * 推送用户领取优惠券消息
     */
    @Scheduled(cron = "0 0/1 * * * ?")
    @Async
    public void pushGetCardMessage(){
        cpnCardMessageService.pushGetCardMessage();
    }

    /**
     * 推送用户核销完优惠券消息
     */
    @Scheduled(cron = "0 0/1 * * * ?")
    @Async
    public void pushConsumeMessage(){
        cpnCardMessageService.pushConsumeMessage();
    }
}
